# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:ios)

platform :ios do
  desc "release new version"
  lane :release do |options|
    target_version = options[:version]
    raise "The version is missed." if target_version.nil?

    version_bump_podspec(
    	path: "RxMoyaCache.podspec", 
    	version_number: target_version)
    git_add(path: "./RxMoyaCache.podspec")
    git_commit(path: ["./RxMoyaCache.podspec", "./fastlane"], message: "release #{target_version} version")
    add_git_tag tag: target_version
    push_to_git_remote
    pod_push(allow_warnings: true)
  end
end
